<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:sec="http://www.springframework.org/security/tags">


    <div id="headerId">
        <h:outputText value="Welcome #{userMBean.loggedUserName()}"/> <br />

        <h:form id="logon">
            <h:commandLink action="/login?faces-redirect=true" rendered="#{sec:areNotGranted('ROLE_USER')}" value="Login" />
            
            <h:outputLink value="#{facesContext.externalContext.requestContextPath}/j_spring_security_logout"  
                          rendered="#{sec:areAnyGranted('ROLE_USER')}" >Logout</h:outputLink>
        </h:form>
    </div>
</ui:composition>